#ifndef __LIB_KFIFO_C
#define __LIB_KFIFO_C

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <stdlib.h>

struct kfifo_handle_t {
    void *cpp_handle;
};

struct kfifo_handle_t *kfifo_create(uint8_t *buffer, uint16_t size);
size_t kfifo_put(struct kfifo_handle_t* handle, const uint8_t* ptr, size_t length);
size_t kfifo_put_force(struct kfifo_handle_t* handle, const uint8_t* ptr, size_t length);
size_t kfifo_get(struct kfifo_handle_t* handle, uint8_t* ptr, size_t length);
size_t kfifo_peek(struct kfifo_handle_t* handle, uint8_t** ptr);
size_t kfifo_putchar(struct kfifo_handle_t* handle, const uint8_t ch);
size_t kfifo_putchar_force(struct kfifo_handle_t* handle, const uint8_t ch);
size_t kfifo_getchar(struct kfifo_handle_t* handle, uint8_t* ch);
size_t kfifo_getchar_force(struct kfifo_handle_t* handle, uint8_t* ch);
size_t kfifo_data_len(struct kfifo_handle_t* handle);
size_t kfifo_data_space_len(struct kfifo_handle_t* handle);
void kfifo_reset(struct kfifo_handle_t* handle);

#ifdef __cplusplus
}
#endif

#endif
